# 方法1
a = 14
b = str(a)
t = 1

while t < 30:
    c = 0
    for i in b:
        c = c + int(i)**2
    b = str(c)
    t += 1
    if int(b) == 1:
        print(f"{a}是快乐数")
        break

if t == 30:
    print(f"{a}不是快乐数")

# 方法2
def change(x):
    sum = 0
    while x > 0:
        j = x % 10
        sum += j*j
        x //= 10
    return sum

def happynumber(n):
    while n > 9:
        n = change(n)
    if n == 1:
        return True
    else:
        return False

print(happynumber(19))




a = 20
a //= 10         # //取商        %取余数    /取可含小数的商
print(a)

print(3/2)